import qs from "qs";
//统一管理项目接口地址
import request from "@/request/request";

//请求热门游记
export const ReMenAPI = () => request.get("/index/banners/travel");
//请求热门兑换数据
// export const ReMenAPI = () => request.get("/products/hot");

//登录请求
export const PhoneReginAPI = (params) => {
  return request.post("/users/login", qs.stringify(params));
};

//检查手机号是否注册
export const IsZhuCeAPI = (params) =>
  request.get("/users/checkPhone", { params });

//注册请求
export const ZhuCeAPI = (params) => {
  return request.post("/users/regist", qs.stringify(params));
};
//获取验证码
//params { phone:13455556666,XXX }
//axios.post(url[,data])
//post给后台的参数，需要qs.stringify() 转换。
// export const SendSMSAPI = (params) =>
//   request.post("/sendSMS", qs.stringify(params));

//登录请求
// export const PhoneReginAPI = (params) => {
//   return request.post("/phoneRegin", qs.stringify(params));
// };
// //微信扫码登录请求
// export const WeiXinLoginAPI = (params) => {
//   return request.post("/wechatUsers/PCLogin", qs.stringify(params));
// };
// //手机号关联微信
// export const BindingAPI = (params) => {
//   return request.post("/wechatUsers/binding", qs.stringify(params));
// };

// //获取用户信息
// export const UserProfilesAPI = () => request.get("/shop/userProfiles");

// //详情页信息    /products/120
// export const GoodsDetailsAPI = (id) => request.get(`/products/${id}`);

// //加入购物车
// export const AddToCartAPI = (params) =>
//   request.post("/shop/carts/add", qs.stringify(params));

// //
// //全部商品-搜素 axios.get(url[,config])
// //params ={did:xxx,type:xxx...}
// export const GoodsSearchAPI = (params) => request.get("/products", { params });
// // params:params

// //查看购物车
// export const ShopCarsAPI = () => request.get("/shop/carts");

// console.log(
//   "qs.stringify:",
//   qs.stringify({ phone: "13699998888", name: "zhangsan" })
// );
//phone=13699998888&name=zhangsan
